package shop.mapper;





import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import shop.pojo.SysUser;

import java.util.List;


@Mapper
public interface SysUserMapper {
    //登录
    SysUser SelectUserByAccountAndPassword(@Param("account") String account,@Param("password") String password);
    //保存用户
    int add(SysUser sysUser);

    //查询用户的数量
    int getUserCount(@Param("realName") String queryRealName,@Param("roleId") Integer queryRoleId);
    //分页查询用户的信息
    List<SysUser> getUserList(@Param("realName")String queryRealName,@Param("roleId") Integer queryRoleId, @Param("pageIndex") Integer pageIndex,@Param("pageSize") int pageSize);

    //查询用户详情根据id
    SysUser getUserById(Integer id);

    SysUser getById(Integer id);

    List<SysUser> getAllUserCount(SysUser sysUser);

    Integer update(SysUser sysUser);

    List selectUserByAccount(String name);

    Integer deleteUserById(Integer userid);

    Integer userExistsById(Integer userId);

    int updatePassword(@Param("id") Long id,@Param("password") String password);

    Integer validateOldPassword(String oldpassword);
}
